package aes;


import client.gui.Client_GUI;
import client.gui.GUI_CreateTest;
import client.gui.GUI_Create_Manual_Test;
import client.gui.GUI_SelectSubjectTest;
import client.gui.GUI_Teacher_Add_Question;
import sharedspace.*;

import fit.ActionFixture;

public class TestCreateExam extends ActionFixture{
	
	GUI_CreateTest gui_createTest;
	GUI_SelectSubjectTest gui_selectSubjectTest;
	String TestDuration = null;
	Client_GUI client_GUI;
	Server_GUI server_GUI;
	User user;
	
	
	public void startServer(String password)
	{
		server_GUI = new Server_GUI();
		server_GUI.getUserTextField().setText("root");
		server_GUI.getPWTextField().setText(password);
		server_GUI.getConnectBtn().doClick();
	}
	//run client with Teacher user
	public void startClient() throws Exception
	{
		client_GUI = new Client_GUI();
		client_GUI.connect();
		user = new User();
		user.setUserID("036855336");
		user.setUserFirstName("Maya");
		user.setUserLastName("Gal");
		user.setUserLogged(true);
		user.setUserPermission(2);
		user.setUserStatus("Active");
		
	}
	
	public void createTest()
	{
		gui_selectSubjectTest=new GUI_SelectSubjectTest(client_GUI, user);
		gui_createTest = new GUI_CreateTest(client_GUI, user,gui_selectSubjectTest.subjectChoosen,gui_selectSubjectTest.courseChoosen,gui_selectSubjectTest.subject);
	}
	
	public void setTestDuration(String duration)
	{
		this.TestDuration = duration;
	}
	public int getTestDuration()
	{
		return gui_createTest.getTestDummy().getTestDuration();
	}
	
	public boolean checkDuration()
	{
		return gui_createTest.cheackDuration(TestDuration);
	}
	
	public void insertToTest()
	{
		gui_createTest.btnAddQ.doClick();
	}
	
	public void DeleteFromTest()
	{
		gui_createTest.btnDelete.doClick();
	}
	
	
	
	public Boolean checkInut() //points
	{
		return gui_createTest.checkInut();
		
	}
	
	public void commentTeacher()
	{
		gui_createTest.test.setCommentForTeacher(gui_createTest.txtCommentTeacher.getText());
	}
	
	public void commentStudent()
	{
		gui_createTest.test.setCommentForStudent(gui_createTest.txtCommentTeacher.getText());
	}
		
	
}
